<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>北京联合大学</title>
</head>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- <link rel="stylesheet" href="https://at.alicdn.com/t/font_835526_xufba1hg66.css"> -->
<link rel="stylesheet" href="https://at.alicdn.com/t/font_835526_uzbxo9d25is.css">
<link rel="stylesheet" href="../../css/Initialization.css">
<link rel="stylesheet" href="../../css/commen.css">
<link rel="stylesheet" href="../../css/teacherlookWork.css">
<body>
<div id="content">
    <div class="initer">
            <!-- 具体内容 -->
            <div class="bread">
                <div class="plain" th:text="${menu.menuname}">成立公司</div>
                <div class="plain">
                    <i class="iconfont icon-right"></i>
                </div>
                <div class="plain current">
                    查看小组作业
                </div>
                <div class="center-button" th:onclick="'javascript:downloadAll(\''+${gradeid}+'\')'">
                    打包下载全部作业
                </div>
            </div>
            <div class="teacherlookwork">
                <div class="title">
                    <div class="unitwork teacherlookworkactive menu">单元个人作业</div>
                    <div class="teamwork menu" th:onclick="'javascript:gopage(\''+${menu.id}+'\',\''+${smenu.id}+'\',\''+${gradeid}+'\')'">单元小组作业</div>
                </div>
                <table class="table unitwork">
                    <tr class="tabletitle">
                        <td>
                            序号
                        </td>
                        <td>
                            姓名
                        </td>
                        <td class="gray">
                            时间
                        </td>
                        <td>
                            完成状态
                        </td>
                        <td>
                            下载
                        </td>
                    </tr>
                    <tr th:each="item : ${pageResult.list}">
                        <td th:text="${item.sort}">1</td>
                        <td th:text="${item.authorname}">张三</td>
                        <td class="gray" th:text="${#dates.format(item.createtime, 'yyyy-MM-dd HH:MM:ss')}">2019-10-20 12:12:12</td>
                        <td>已完成</td>
                        <td>
                            <div class="options">
                                <!--span class="gray">张三第一单元作业.DOCX</span-->
                                <input type="hidden" th:value="${item.attachments}" id="downurl"/>
                                <span class="min-button" th:onclick="'javascript:jump(this)'">下载</span>
                            </div>
                        </td>
                    </tr>
                </table>

                <!-- 分页 -->
                <div class="pages" th:utext="${pageResult.getPageHtml()}"></div>
            </div>
        </div>
</div>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/commen.js"></script>
<script>
    function gopage(mid,sid,gradeid) {
        location.href = "teacherGroupList?mid="+mid + "&sid="+sid+"&gradeid="+gradeid;
    }

    function jump(obj){
        var downurl = $(obj).parent().find("#downurl").val();
        location.href = downurl;
    }
    
    function downloadAll(gradeid) {
        location.href = "/file/downloadZIP?type=0&id="+gradeid;
    }
</script>
</body>
</html>

